@extends('layouts.app')

@section('content')
   <div id="tt" class="easyui-tabs" style="width:100%;" data-options="border:false,fit:true,plain:true">
                <div title="情报研判/积分项设置">
                    <div class="main-content">
                        <div class="btn-toolbar list-toolbar">
                            <div class="form-all mg_t100">
                                <div class="inp_biaodan">

                                    <form name="add_form" id="add_form" action="{{url('admin/bg/addbg')}}" method="post" enctype="multipart/form-data">

                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">

                                    <table class="table table-bordered table-form table-border inp_biaodan_table">
                                        <thead>
                                            <tr>
                                                <th colspan="6" class="tt">灾害事故设置</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td width="102">伤亡事故</td>
                                                <td><input type="text" value="{{$config['swsg']}}" name="swsg"/></td>
                                                <td width="102">火灾事故</td>
                                                <td><input type="text" value="{{$config['hzsg']}}" name="hzsg"/></td>
                                                <td width="102">爆炸事故</td>
                                                <td><input type="text" value="{{$config['bzsg']}}" name="bzsg"/></td>
                                            </tr>
                                            <tr>
                                                <td>设备事故</td>
                                                <td><input type="text" value="{{$config['sbsg']}}" name="sbsg"/></td>
                                                <td>质量事故</td>
                                                <td><input type="text" value="{{$config['zlsg']}}" name="zlsg"/></td>
                                                <td>污染事故</td>
                                                <td><input type="text" value="{{$config['wrsg']}}" name="wrsg"/></td>
                                            </tr>

                                             <tr>
                                                <td>交通事故</td>
                                                <td><input type="text" value="{{$config['zrzhsg']}}" name="zrzhsg"/></td>
                                                <td>自然灾害事故</td>
                                                <td><input type="text" value="{{$config['zrzhsg']}}" name="zrzhsg"/></td>
                                                <td>生产操作事故</td>
                                                <td><input type="text" value="{{$config['scczsg']}}" name="scczsg"/></td>
                                            </tr>
                                        </tbody>
                                    </table>

                                     <table class="table table-bordered table-form table-border inp_biaodan_table">
                                        <thead>
                                            <tr>
                                                <th colspan="6" class="tt">安全检查设置</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td>检查合格</td>
                                                <td><input type="text" class="easyui-validatebox" value="{{$config['hege']}}" name="hege" data-options="required:true,missingMessage:'检查合格不能为空',validateOnCreate:false,validateOnBlur:true"/></td>
                                                <td>检查不合格</td>
                                                <td><input type="text" class="easyui-validatebox" value="{{$config['buhege']}}" name="buhege" data-options="required:true,missingMessage:'检查不合格不能为空',validateOnCreate:false,validateOnBlur:true"/></td>
                                             
                                            </tr>
                                    
                                        </tbody>
                                    </table>

                                    <table class="table table-bordered table-form table-border inp_biaodan_table">
                                        <thead>
                                            <tr>
                                                <th colspan="6" class="tt">不安定因素设置</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td width="173">每个不安定因素扣分</td>
                                                <td><input type="text" class="easyui-validatebox" value="{{$config['buanding']}}" name="buanding" data-options="required:true,missingMessage:'不安定因素扣分不能为空',validateOnCreate:false,validateOnBlur:true"/></td>
                                            </tr>
                                    
                                        </tbody>
                                    </table>


                                     <table class="table table-bordered table-form table-border inp_biaodan_table">
                                        <thead>
                                            <tr>
                                                <th colspan="6" class="tt">案件设置</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td width="173">每起案件扣分</td>
                                                <td><input type="text" class="easyui-validatebox" value="{{$config['anjian']}}" name="anjian" data-options="required:true,missingMessage:'每起案件扣分不能为空',validateOnCreate:false,validateOnBlur:true"/></td>

                                            </tr>
                                    
                                        </tbody>
                                    </table>



                                     <table class="table table-bordered table-form table-border inp_biaodan_table">
                                        <thead>
                                            <tr>
                                                <th colspan="6" class="tt">灾情统计设置</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td>受伤扣分（分/人）</td>
                                                <td><input type="text" class="easyui-validatebox" value="{{$config['shoushang']}}" name="shoushang" data-options="required:true,missingMessage:'受伤扣分不能为空',validateOnCreate:false,validateOnBlur:true"/></td>
                                                 <td>死亡扣分（分/人）</td>
                                                <td><input type="text" class="easyui-validatebox" value="{{$config['siwang']}}" name="siwang" data-options="required:true,missingMessage:'死亡扣分不能为空',validateOnCreate:false,validateOnBlur:true"/></td>
                                                 <td>损失扣分（分/千元）</td>
                                                <td><input type="text" class="easyui-validatebox" value="{{$config['sunshi']}}" name="sunshi" data-options="required:true,missingMessage:'损失扣分不能为空',validateOnCreate:false,validateOnBlur:true"/></td>
                                            </tr>
                                    
                                        </tbody>
                                    </table>
                                    </form>






                                    <button id="go" type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-save'">保存</button>
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


              <script>
                $('#go').click(function (){
                	if(!$("#add_form").form('validate')){
					return false;
					}
                    $.ajax({
                        cache: true,
                        type: "POST",
                        url: "{{url('admin/yanpan/mark')}}",
                        data:$('#add_form').serialize(),
                        async: false,
                        success: function(data) {
                            if(data.status == 1){
                                $.messager.alert('信息提示',data.msg,'info');
                            
                            }else {
                                $.messager.alert('信息提示',data.msg,'info');
                            }
                        }
                    });
                });
        </script>




<style type="text/css">
.inp_biaodan {
    padding: 10px;
}
.inp_biaodan_tt {
    margin-bottom: 20px;
    margin-left: 15px;
}
.inp_biaodan_table thead tr th{
    border-bottom: 1px solid #95b8e7;
}
.inp_biaodan .noFloat label {
    display: block;
}
.inp_biaodan input ,.inp_biaodan_table select {
    padding-left: 5px;
    height: 28px;
    margin-right: 10px;
    border-color: #95b8e7;
    border-width: 1px;
    border-style: solid;
    width: 100%;
}
.inp_biaodan textarea {
    height: 70px;
    width: 100%;
    border: 1px solid #95b8e7;
}
.inp_biaodan_table td{
    border: 1px solid #95b8e7;
    background: #ffffff;
    padding: 4px !important;
    color: #000060;

}
.inp_biaodan_table thead tr th.tt 

 {
    font-size: 15px;
    text-align: left !important;
    padding-left: 15px !important;
    background: none;
    color: #000060;
}

.inp_biaodan_table thead
{
    background-color: #f8fbff;
    background: -webkit-linear-gradient(top,#fdfdfd 0,#fbfbff 100%); 
    background: -moz-linear-gradient(top,#fdfdfd 0,#fbfbff 100%);
    background: -o-linear-gradient(top,#fdfdfd 0,#fbfbff 100%);
    background: linear-gradient(to bottom,#fdfdfd 0,#fbfbff 100%); 
    background-repeat: repeat-x;
}   

.tongjitu_tb thead th{
    text-align: center;
    font-size: 25px;
    height: 50px;
}
.tongjitu_tb  .thead{
    text-align: center; 
    border: 1px solid #95B8E7;
    font-weight: bold;
    height: 85px;
}
.tongjitu_tb  .thead {
    height: 45px;
}
.tongjitu_tb tbody td{
    text-align: center; 
    border: 1px solid #95B8E7;
    padding: 4px !important;
    color: #000060;
}
.tongjitu_tb input {
    width: 100%;
    height: 40px;
    border: none;
    text-align: center;
    background: none;
}
</style>

   <script>
       $(document).ready(function(){
           var winHeight =  window.screen.height;
           var winWidth = 	window.screen.width;
           if(winWidth == 1024){
               $('#taby').css('height',465+'px');
               $('#taby').find('iframe').css('height',436+'px');
           }else if(winWidth == 1280){
               $('#taby').css('height',465+'px');
               $('#taby').find('iframe').css('height',436+'px');
           }else if(winWidth == 1366){
               $('#taby').css('height',465+'px'); $('#taby').find('iframe').css('min-height',436+'px');
           }else if(winWidth == 1920){
               $('#taby').css('height',625+'px');
               $('#taby').find('iframe').css('min-height',596+'px');
           }else{
               $('#taby').css('height',465+'px');
               $('#taby').find('iframe').css('min-height',436+'px');
           }
       })

       function load_city_data_from_menu($id){
           $('#dg').datagrid('load',{
               city: $id,
           });
           $("input[name='city']").val($id);
           $("input[name='area']").val('');
           $("input[name='org_id']").val('');
       }

       function load_area_data_from_menu($id){
           $('#dg').datagrid('load',{
               area: $id,
           });
           $("input[name='city']").val('');
           $("input[name='area']").val($id);
           $("input[name='org_id']").val('');
       }
       function load_org_data_from_menu($id){
           $('#dg').datagrid('load',{
               org_id: $id,
           });
           $("input[name='city']").val('');
           $("input[name='area']").val('');
           $("input[name='org_id']").val($id);
       }
   </script>

@stop